home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 25 / CU Amiga Magazine's Super CD-ROM 25 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-08].iso / CUCD / Programming / QuakeTools / src / libqbuild / light.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-06-11  |  2.2 KB  |  94 lines

  1. #ifndef    LIGHT_H
  2. #define    LIGHT_H
  3. /*
  4.  * ============================================================================
  5.  * structures
  6.  * ============================================================================
  7.  */
  8.  
  9. typedef enum {
  10.   emit_surface,
  11.   emit_point,
  12.   emit_spotlight
  13. } __packed emittype_t;
  14.  
  15. #define    MAXLIGHTS            1024
  16. #define    SINGLEMAP            (18*18*4)
  17. //#define    SINGLEMAP        (64*64*4)
  18. #define    MAX_STYLES            32
  19. #define    DIRECT_LIGHT            3
  20. #define    MAX_LSTYLES            256
  21.  
  22. struct lightinfo {
  23.   vec_t lightmaps[MAXLIGHTMAPS][SINGLEMAP];
  24.   int numlightstyles;
  25.   vec_t *light;
  26.   vec_t facedist;
  27.   vec3_t facenormal;
  28.   int numsurfpt;
  29.   vec3_t surfpt[SINGLEMAP];
  30.   vec3_t modelorg;                                   // for origined bmodels
  31.   vec3_t texorg;
  32.   vec3_t worldtotex[2];                                   // s = (world - texorg) . worldtotex[0]
  33.   vec3_t textoworld[2];                                   // world = texorg + s * textoworld[0]
  34.   vec_t exactmins[2], exactmaxs[2];
  35.   int texmins[2], texsize[2];
  36.   int lightstyles[256];
  37.   int surfnum;
  38.   struct dface_t *face;
  39. } __packed;
  40.  
  41. struct facelight {
  42.   int numsamples;
  43.   float *origins;
  44.   int numstyles;
  45.   int stylenums[MAX_STYLES];
  46.   float *samples[MAX_STYLES];
  47. } __packed;
  48.  
  49. struct directlight {
  50.   struct directlight *next;
  51.   emittype_t type;
  52.   float intensity;
  53.   int style;
  54.   vec3_t origin;
  55.   vec3_t color;
  56.   vec3_t normal;                                   // for surfaces and spotlights
  57.   float stopdot;                                   // for spotlights
  58. } __packed;
  59.  
  60. typedef struct {
  61.   vec3_t backpt;
  62.   int side;
  63.   int node;
  64. } __packed tracestack_t;
  65.  
  66. struct tnode {
  67.   int type;
  68.   vec3_t normal;
  69.   float dist;
  70.   int children[2];
  71.   int pad;
  72. } __packed;
  73.  
  74. /*
  75.  * ============================================================================
  76.  * globals
  77.  * ============================================================================
  78.  */
  79.  
  80. extern vec3_t *faceoffset;
  81. extern int bspfileface;                        // next surface to dispatch
  82.  
  83. /*
  84.  * ============================================================================
  85.  * prototypes
  86.  * ============================================================================
  87.  */
  88.  
  89. int TestLine_r(register int node, vec3_t start, vec3_t stop);
  90. void CalcFaceVectors(__memBase, register struct lightinfo *l);
  91. void CalcPoints(__memBase, struct lightinfo *l, register float sofs, register float tofs);
  92.  
  93. #endif
  94.